package com.ethink.order.facadeImpl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ethink.order.api.TocSaleImportLogFacade;
import com.ethink.order.api.info.TocSaleImportLogDetailInfo;
import com.ethink.order.api.info.TocSaleImportLogInfo;
import com.ethink.order.api.model.TocSaleImportLogModel;
import com.ethink.order.api.request.*;
import com.ethink.order.api.response.TocSaleImportLogQueryDetailResponse;
import com.ethink.order.service.TocSaleImportLogDetailService;
import com.ethink.order.service.TocSaleImportLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * TOC销售单导入日志 Facade接口实现
 *
 * @author default
 * @date 2022-11-22
 */
@RestController
@Slf4j
@RequestMapping("order-service/facade/v1/tocSaleImportLog")
public class TocSaleImportLogFacadeImpl implements TocSaleImportLogFacade {

    @Autowired
    private TocSaleImportLogService tocSaleImportLogService;

    @Autowired
    private TocSaleImportLogDetailService tocSaleImportLogDetailService;

    @Override
    public Integer addTocSaleOrder(TocSaleImportLogAddRequest request) {
        return tocSaleImportLogService.addTocSaleOrder(request);
    }

    @Override
    public Page<TocSaleImportLogModel> pageQuery(TocSaleImportLogQueryRequest request) {
        return tocSaleImportLogService.pageQuery(request);
    }

    @Override
    public Integer delete(Long id) {
        return tocSaleImportLogService.delete(id);
    }

    @Override
    public TocSaleImportLogQueryDetailResponse queryDetail(Long id) {
        return tocSaleImportLogService.queryDetail(id);
    }

    @Override
    public Integer updateStatus(SaleOrderUpdateStatusRequest request) {
        return tocSaleImportLogService.updateStatus(request);
    }

    @Override
    public List<TocSaleImportLogDetailInfo> queryDetailByShopOrderNoAndMateSku(List<TocSaleImportLogDetailQueryRequest> requests) {
        return tocSaleImportLogDetailService.queryDetailByShopOrderNoAndMateSku(requests);
    }

    @Override
    public List<TocSaleImportLogDetailInfo> queryDetailByShopOrderNo(List<String> shopOrderNoList) {
        return tocSaleImportLogDetailService.queryDetailByShopOrderNo(shopOrderNoList);
    }

    @Override
    public List<Long> selectNotProcessed() {
        return tocSaleImportLogService.selectNotProcessed();
    }

    @Override
    public List<TocSaleImportLogDetailInfo> queryDetailByIds(List<Long> ids) {
        return tocSaleImportLogDetailService.queryDetailByIds(ids);
    }

    @Override
    public TocSaleImportLogInfo queryById(Long id) {
        return tocSaleImportLogService.queryById(id);
    }

    @Override
    public List<String> checkShopOrderNoIfExist(CheckShopOrderNoIfExistRequest checkShopOrderNoIfExistRequest) {
        return tocSaleImportLogService.checkShopOrderNoIfExist(checkShopOrderNoIfExistRequest);
    }
}